package com.ktjy.goods.controller;


import com.ktjy.common.core.controller.BaseController;
import com.ktjy.common.core.page.TableDataInfo;
import com.ktjy.goods.domain.TAttrValues;
import com.ktjy.goods.domain.TGoodsInfo;
import com.ktjy.goods.service.ITAttrValuesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 规格属性值表 前端控制器
 * </p>
 *
 * @author author
 * @since 2025-03-18
 */
@RestController
@RequestMapping("/goods/attrValues")
public class TAttrValuesController extends BaseController {

    @Autowired
    private ITAttrValuesService itAttrValuesService;

    @PreAuthorize("@ss.hasPermi('goods:attrValues:list')")
    @GetMapping("/list")
    public TableDataInfo list(TAttrValues tAttrValues)
    {
        System.out.println("attrValues()--------------------");
        startPage();
        List<TAttrValues> list = itAttrValuesService.selectAttrValuesList(tAttrValues);
        return getDataTable(list);
    }

    @PreAuthorize("@ss.hasPermi('goods:attrValues:getAttrValues')")
    @GetMapping("/getAttrValues")
    public TableDataInfo getAttrValues(Long attrId, Long goodsId)
    {
        System.out.println("getAttrValues()--------------------" + attrId);
        System.out.println("getAttrValues()--------------------" + goodsId);
        List<TAttrValues> list = itAttrValuesService.getAttrValues(attrId, goodsId);
        return getDataTable(list);
    }

}
